<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>系统管理</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" media="screen, projection, print" href="<%=path %>/ext-3.4.0/resources/css/ext-all.css" />
	<script type="text/javascript" src="<%=path %>/ext-3.4.0/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=path %>/ext-3.4.0/ext-all.js"></script>
	<script type="text/javascript" src="<%=path %>/ext-3.4.0/fck.js"></script>
  </head>
  <body>
  <script type="text/javascript">
  Ext.onReady(function(){
  	Ext.BALNK_IMAGE_URL = "./ext-3.4.0/resources/images/default\s.gif";
  	Ext.QuickTips.init();
  	Ext.form.Field.prototype.msgTarget = "side";
  
  	//登陆面板
  	var panelform = new Ext.FormPanel({
	    title: '',
	    height:110,
	    frame: true,
	    labelWidth:40,
	    padding:'10 10 10 10',
	    items: [{
	    	name:'username',
	        xtype: 'textfield',
	        allowBlank:false,
	        width:150,
	        emptyText:'请输入用户名',
	        fieldLabel: '用户名'
	    },{
	    	name:'password',
	        xtype:'textfield',
	        inputType:'password',
	        allowBlank:false,
	        width:150,
	        emptyText:'请输入密码',
	        fieldLabel: '密码'
	    }],
	    buttons:[
	    	new Ext.Button({
	    		text:'提交',
	    		handler:function(){
	    			if(panelform.form.isValid()){
	    				panelform.form.submit({
	    					clientValidation:true,
	    					waitMsg:'正在登陆系统，请稍候',
	    					waitTitle:'系统登陆中...',
	    					url:'<%=path%>/login.do?method=checkuser',
	    					method:'post',
	    					success:function(form,action){
	    						Ext.Msg.alert("提示","系统登陆成功");
	    						window.location.href = "<%=path%>/manager.do?method=main";
	    					},
	    					failure:function(form,action){
	    						Ext.Msg.alert('提示','系统登陆失败:'+action.failureType);
	    					}
	    				})
	    			}
	    		}
	    	})
	    ]
	})
  	//窗口
  	var loginWindow = new Ext.Window({
  		title:"系统登陆",
  		width:"260",
  		height:"210",
  		items:[panelform]
  	});
  	
  	loginWindow.show();
  });
  </script>
  </body>
</html>
